﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Reflexive.IO;
using System.Management;
using Microsoft.Diagnostics.Tracing;

namespace Reflexive.IO.Examples
{
    /*
     * Bounding Min or Max
     * Limiting Min and Max
     * Imperative Must be 
     * Bounded Imperative Must be  
     * Transitive
     */
    //http://msdn.microsoft.com/en-us/library/bb427443(VS.85).aspx
    //http://msdn.microsoft.com/en-us/library/bb870973(v=vs.85).aspx
    //http://msdn.microsoft.com/en-us/library/bb513652(v=vs.85).aspx
    public class TraceEventConverter : TypeConverter, ITypeConverter<TraceEvent,string>
    {

        public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
        {
 	         return true;
        }

        public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
        {
            TraceEvent ev = (TraceEvent)value;
            return (string)ev.ToString();
        }


        public string Convert(TraceEvent source)
        {
            return (string)ConvertTo(source,typeof(string));
        }
    }

}
